package cn.biplam.front.component.data.tree;

import cn.biplam.common.wrapper.ErrorMessage;

/**
 * 索引表树节点记录ID解析类
 * @author XiaoRuxing 2009-6-23上午10:09:20
 * @version 1.0
 */
public class OptTreeRecordId{
	
	/** 索引表ID */
	private String indexNodeID;
	/** 节点对应的物理表ID */
	private String realID;
	/** 节点的级别 */
	private String indexNodeLevel;
	/** 节点类型 */
	private String indexNodeType;
	
	/**
	 * 传入节点ID创建索引表树节点ID解析类
	 * @param recordID 索引表树节点ID
	 * @throws ErrorMessage
	 */
	public OptTreeRecordId(String recordID) throws ErrorMessage{
		String[] node = recordID.split(",");
		if(node.length!=4){
			throw new ErrorMessage(" Record is "+recordID+" not a tree record !");
		}
		indexNodeID = node[0];
		realID = node[1];
		indexNodeLevel = node[2];
		indexNodeType = node[3];
	}

	/**
	 * 获取节点索引表ID
	 * @return 节点索引表ID
	 */
	public String getIndexNodeID() {
		return indexNodeID;
	}

	/**
	 * 获取节点物理表ID 
	 * @return 节点物理表ID
	 */
	public String getRealID() {
		return realID;
	}

	/**
	 * 获取节点级别 
	 * @return 节点级别
	 */
	public String getIndexNodeLevel() {
		return indexNodeLevel;
	}

	/**
	 * 获取节点类型
	 * @return 节点类型
	 */
	public String getIndexNodeType() {
		return indexNodeType;
	}
}
